package miracle.joker.design.factory_method;

/*
具体产品Dog
*/
public class Dog implements Animal{

    private String name;

    public Dog() {
    }

    public Dog(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void makesound() {
        if (getName() != null && getName() != ""){
            System.out.println(getName() + ": 汪汪~");
        } else {
            System.out.println("汪汪~");
        }
    }
}
